package org.dromara.llm.domain;

import lombok.Getter;

/**
 * 文件处理状态
 *  处理状态 // "UPLOADED", "COMPLETED", "FAILED"
 * @author miles
 * @version V1.0
 * @date 2025-05-07
 */
@Getter
public enum FilesStatus {
    /**
     * 上传
     */
    UPLOADED("上传", "UPLOADED"),
    /**
     * 完成
     */
    COMPLETED("完成", "COMPLETED"),
    /**
     * 失败
     */
    FAILED("失败", "FAILED");

    private final String name;
    private final String statusCode;

    FilesStatus(String name, String statusCode) {
        this.name = name;
        this.statusCode = statusCode;
    }

    /**
     * 通过statusCode获取
     *
     * @param statusCode 代码
     * @return 对象
     */
    public static FilesStatus getByCode(String statusCode) {
        for (FilesStatus enumObj : values()) {
            if (enumObj.statusCode.equals(statusCode)) {
                return enumObj;
            }
        }
        return null;
    }

}
